#ifndef PROJECTION_GPU_H
#define PROJECTION_GPU_H

#include "CUDAAcceleration.h"
#include <opencv2\opencv.hpp>

class UniversalDimensionConvertor;
class LinearInterpolation_PGR;

class Projection_GPU{
public:
	Projection_GPU(const int k, int width, int height, const cv::Mat& Intrinsic);
	~Projection_GPU();
	void setClusterNDandCenter(float4* in, float3* center);
	void setClusterMap(int* labels);	//assume GPU memory available
	void setinterpolationData(const float3* interpolated3d_device, const float2* interpolated2d_device);
	void Interpolation(float3* interpolated_depthmap_host);
	void PlaneProjection(float3* upsampled3d_host);	

private:
	void initMemory();
	void getProjectedMap();
	
	
	UniversalDimensionConvertor* dim;
	LinearInterpolation_PGR*	InterpolationPGR;
	int k;
	int width;
	int height;
	float ClusterRadius;
	const float3*			Interpolated3D_Device;
	const float2*			Interpolated2D_Device;
	float3*					InterpolatedDepthMap_Device;
	float*					InterpolatedPGRDepth_Device;	//order is camera
	float3*					InterpolatedPGR3D_Device;		//order is camera
	float3*					Upsampled3D_Device;
	float3*					Normalized3D_Device;
	float3*					Filtered_Host;
	//float3*					Approximated3D_Device;
	float2*					Upsampled2D_Device;
	float4*					normal_device;
	float3*					ClusterCenter_Device;

	int* labels_device;
};
#endif